import argparse

import utils
import bot.main as bot_main
import scraper.main as scraper_main


def work_with_scraper(list_of_passed_arguments: argparse.Namespace) -> None:
    """ Работаем с парсером """

    scraper_main.run_scraper(
        list_of_passed_arguments
    )


def work_with_bot(list_of_passed_arguments: argparse.Namespace) -> None:
    """ Работаем с ботом """

    bot_main.run_bot(
        list_of_passed_arguments
    )


def main() -> None:
    """ Точка входа """

    utils.check_presence_of_env()
    list_of_passed_arguments = utils.InputDataFromUser().get_list_of_passed_arguments()

    if list_of_passed_arguments.use == 'scraper':
        work_with_scraper(list_of_passed_arguments)
    elif list_of_passed_arguments.use == 'bot':
        work_with_bot(list_of_passed_arguments)


if __name__ == '__main__':
    main()
